﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="custom.aspx.cs" Inherits="He.Web.manage.collect.custom" %>

<%@ Register Src="../_uc/head.ascx" TagPrefix="uc" TagName="head" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>自定义采集源</title>
    <uc:head runat="server" ID="uchead" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="navigation">
        <span class="back"><a href='javascript:(history.go(-1))'>返回菜单</a></span> <b>您当前的位置：首页
            &gt; 采集管理&gt;自定义采集源</b>
    </div>
    <div class="spClear">
    </div>
  <asp:Panel ID="p1" runat="server">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="msgtable">
      <tr>
        <th align="left" colspan="2">Step1:侦测抓取列表页 </th>
      </tr>
      <tr>
        <td align="right" width="200">*列表页编码： </td>
        <td>
          <asp:DropDownList ID="ddlListEncode" runat="server">
            <asp:ListItem Text="utf-8" />
            <asp:ListItem Text="gb2312" />
            <asp:ListItem Text="GBK" />
            <asp:ListItem Text="Big5" />
          </asp:DropDownList>
        </td>
      </tr>
      <tr>
        <td align="right">*列表页Url：</td>
        <td>
          <asp:TextBox ID="txtListUrl" Width="500" runat="server" /></td>
      </tr>
      <tr>
        <td align="right">*列表页a标签的选择器：</td>
        <td>
          <asp:TextBox ID="txtASelector" Width="500" runat="server" /><br />
          直接用FireBug获取Css路径，如获取不到请手工编写，类似：h2.news a</td>
      </tr>
      <tr>
        <td align="right">补充域名(链接不带域名时填写)：</td>
        <td>
          <asp:TextBox ID="txtDomain" runat="server" Width="500" /></td>
      </tr>
      <tr>
        <td></td>
        <td>
          <asp:Button ID="Button5" Text="下一步" OnClientClick="return checkForm(this)" OnClick="btnTestList_Click"
            Width="200" Height="30" runat="server" /><span style="display: none">
              <img src="../images/loading.gif" />执行中，请稍后...</span> </td>
      </tr>
    </table>
  </asp:Panel>
  <asp:Panel ID="p2" runat="server">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="msgtable">
      <tr>
        <th align="left" colspan="2">Step2:侦测抓取详细页 </th>
      </tr>
      <tr>
        <td align="right" width="200">*详细页编码： </td>
        <td>
          <asp:DropDownList ID="ddlDetailEncode" runat="server">
            <asp:ListItem Text="utf-8" />
            <asp:ListItem Text="gb2312" />
            <asp:ListItem Text="GBK" />
            <asp:ListItem Text="Big5" />
          </asp:DropDownList>
        </td>
      </tr>
      <tr>
        <td align="right">*选择详细页Url：</td>
        <td>
          <asp:DropDownList ID="ddlDetailUrl" AutoPostBack="true" runat="server" OnSelectedIndexChanged="ddlDetailUrl_SelectedIndexChanged" />
        </td>
      </tr>
      <tr>
        <td align="right">*详细页Url：</td>
        <td>
          <asp:TextBox ID="txtDetailUrl" Width="500" runat="server" /></td>
      </tr>
      <tr>
        <td align="right">*详细内容标签的选择器：</td>
        <td>
          <asp:TextBox ID="txtDetailSelector" Width="500" runat="server" /><br />
          直接用FireBug获取Css路径，如获取不到请手工编写，类似：div:nth-child(1) 或者 div.article table tr:nth-child(3) td</td>
      </tr>
      <tr>
        <td></td>
        <td>
          <asp:Button ID="Button1" Text="下一步" OnClientClick="return checkForm(this)" OnClick="btnTestDetail_Click"
            Width="200" Height="30" runat="server" /><span style="display: none">
              <img src="../images/loading.gif" />执行中，请稍后...</span>
          <asp:Button ID="Button2" Text="返回" OnClick="btnBack1_Click" runat="server" />
        </td>
      </tr>
    </table>
  </asp:Panel>
  <asp:Panel ID="p3" runat="server">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="msgtable">
      <tr>
        <th align="left" colspan="2">Step3:设置多个列表页并采集 </th>
      </tr>
      <tr>
        <td align="right" width="200">*数据源列表页URL：</td>
        <td>
          <asp:TextBox ID="txtMulUrl" TextMode="MultiLine" Width="500" Height="100" runat="server" />
        </td>
      </tr>
      <tr>
        <td align="right">*目标栏目分类：</td>
        <td>
          <asp:DropDownList ID="ddlLang" AutoPostBack="true" runat="server" OnSelectedIndexChanged="ddlLang_SelectedIndexChanged" />
          <asp:DropDownList ID="ddlChannel" AutoPostBack="true" runat="server" OnSelectedIndexChanged="ddlChannel_SelectedIndexChanged" />
          <asp:DropDownList ID="ddlCategory" runat="server" />
        </td>
      </tr>
      <tr>
        <td></td>
        <td>
          <asp:Button ID="Button3" Text="开始采集" OnClientClick="return checkForm(this)" OnClick="btnCaiji_Click"
            Width="200" Height="30" runat="server" />
          <span style="display: none">
            <img src="../images/loading.gif" />执行中，请稍后...</span>
          <asp:Button ID="Button4" Text="返回" OnClick="btnBack2_Click" runat="server" /></td>
      </tr>
    </table>
  </asp:Panel>
  <div>
    <asp:Literal ID="litMsg" runat="server" /></div>
  <script type="text/javascript">
      function checkForm(obj) {
          if (confirm('此操作耗时较长，执行后不可逆，确认执行？')) {
              $(obj).hide().next('span').eq(0).show();
              return true;
          } else {
              return false;
          }
      }
  </script>
    </form>
</body>
</html>
